class People {
    name: string;
    _age: number = 0;
    addr: string;
    static count: number = 0
    constructor(_name: string, _addr: string) {
        this.name = _name;
        this.addr = _addr;
        People.count++;
    }
    set age(val: number) {
        if (val > 10 && val < 128) {
            this._age = val
        } else {
            throw new Error("年龄不合法")
        }
    }
    get age() {
        return this._age
    }
    doEat() {

    }
    doStep() {

    }
}
let p = new People('Wangwu', 'beijing')
p.age = 200
export { }